<template>
    <div class="cx_left">

        <el-form :model="form" label-width="auto" style="max-width: 600px">
            <el-form-item label="字段名称">
                <el-input v-model="form.label" placeholder="请输入字段名称" />
            </el-form-item>

            <el-form-item label="字段KEY">
                <el-input v-model="form.prop" placeholder="请输入字段KEY" />
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="sure">确定修改</el-button>
            </el-form-item>
        </el-form>

    </div>
</template>

<script setup name="addEdit">
import { sendEmitter, putEmitter } from '@/utils/events'
import { deepClone } from "@/utils/index";

const { proxy } = getCurrentInstance();
const emit = defineEmits(["refresh"]);
const data = reactive({
    form: {},
});
const { form } = toRefs(data);
sendEmitter.on('sendEmitter', (val) => {
    form.value = deepClone(val)
})

const sure = () => {
    putEmitter.emit('putEmitter', form.value)
}
</script>
<style lang="scss" scoped>
.cx_left {
    background: #fff;
    padding: 10px;
    width: 30%;

}

.box_item {
    width: 30%;
    display: flex;
    flex-wrap: wrap;
}

.w-cp-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.item {
    flex-shrink: 0;
    width: calc(50% - 20px);
    text-align: center;
    padding: 10px;
    margin: 10px;
    display: inline-block;
    background: #F0F0F0;
}
</style>